<template>
	<view>
		<view class="top-bg-view"></view>
		<view class="info-box">
			<uni-list>
				<uni-list-chat 
					avatar-circle
					:avatar="avatar" 
					:title="nickName">
				</uni-list-chat>
			</uni-list>
		</view>
		<view class="menu-list" @click="skip('/pages/mine/collect')">
			<uni-list>
				<uni-list-item :show-extra-icon="true" showArrow>
					<template v-slot:header>
							<uni-icons class="menu-icon" type="star" size="20"></uni-icons>
						</template>
						<template v-slot:body>
							<view class="title">我的收藏</view>
						</template>
				</uni-list-item>
			</uni-list>
		</view>
		<view class="menu-list" @click="skip('/pages/mine/attention')">
			<uni-list>
				<uni-list-item :show-extra-icon="true" showArrow>
					<template v-slot:header>
							<uni-icons class="menu-icon" type="heart" size="20"></uni-icons>
						</template>
						<template v-slot:body>
							<view class="title">我的关注</view>
							</template>
				</uni-list-item>
			</uni-list>
		</view>
		<view class="menu-list" @click="skip('/pages/mine/about')">
			<uni-list>
				<uni-list-item :show-extra-icon="true" showArrow>
					<template v-slot:header>
							<uni-icons class="menu-icon" type="wallet" size="20"></uni-icons>
						</template>
						<template v-slot:body>
							<view class="title">关于我们</view>
							</template>
				</uni-list-item>
			</uni-list>
		</view>
		<!-- <view class="menu-list" @click="customerService()">
			<uni-list>
				<uni-list-item :show-extra-icon="true" showArrow>
					<template v-slot:header>
							<uni-icons class="menu-icon" type="phone" size="20"></uni-icons>
						</template>
						<template v-slot:body>
							<view class="title">联系客服</view>
							</template>
				</uni-list-item>
			</uni-list>
		</view> -->
		<!-- <view class="menu-list" @click="skip('/pages/mine/regard')">
			<uni-list>
				<uni-list-item :show-extra-icon="true" showArrow>
					<template v-slot:header>
							<uni-icons class="menu-icon" type="wallet" size="20"></uni-icons>
						</template>
						<template v-slot:body>
							<view class="title">关于资源库</view>
							</template>
				</uni-list-item>
			</uni-list>
		</view> -->
	</view>
</template>

<script>
export default {
	data() {
		return {
			avatar:uni.getStorageSync('avatarUrl'),
			nickName:uni.getStorageSync('memberName')
		}
	},
	onLoad(){
		if(!uni.getStorageSync('memberName') || !uni.getStorageSync('avatarUrl')){
			uni.reLaunch({
				url: '/pages/mine/login'
			});
		}
	},
	methods: {
		// 收藏
		skip(url){
			uni.navigateTo({
				url:url
			});
		},
		// 联系客服
		customerService(){
			uni.makePhoneCall({
			  phoneNumber: '10086'
			});
		}
	}
}
</script>

<style lang="scss" scoped>
page{
	background: white;
}
.top-bg-view{
	width: 100%;
	height: 194rpx;
	background: #27A280;
}
.info-box{
	margin-top: -80rpx;
	margin-left: 30rpx;
	margin-right: 30rpx;
	box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.08);
	border-radius: 32rpx;
	overflow: hidden;
}
.menu-list{
	margin-top: 30rpx;
	margin-left: 30rpx;
	margin-right: 30rpx;
	box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.08);
	border-radius: 32rpx;
	overflow: hidden;
	.menu-icon{
		margin-right: 30rpx;
	}
	.title{
		font-size: 28rpx;
		color: #666666;
		font-weight: bold;
	}
}
/deep/.uni-list-chat__content{
	padding:24rpx 0 !important;
}
</style>
